﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Othello_Game
{
    /// <summary>
    /// This class implements the IComparer interface for ActionList.
    /// We will use it to compare the value of two Othello_Game.ActionList.
    /// </summary>
    public class CompareActionListValues : IComparer<ActionList>
    {
        #region IComparer<ActionList> Members

        /// <summary>
        /// Compares two ActionLists.
        /// </summary>
        /// <param name="x">The first ActionList to compare.</param>
        /// <param name="y">The second ActionList to compare</param>
        /// <returns>
        /// Value Condition - Less than zero:x is less than y.
        ///                   Zero: x equals y.
        ///                   Greater than zero: x is greater than y.
        /// </returns>
        public int Compare(ActionList x, ActionList y)
        {
            double xValue = x.AlphaValue;
            double yValue = y.AlphaValue;

            return yValue.CompareTo(xValue);
        }

        #endregion
    }
}
